<?php

namespace vico\reservarBundle\Form;

use Symfony\Component\Form\AbstractType;
use Symfony\Component\Form\FormBuilderInterface;
use Symfony\Component\OptionsResolver\OptionsResolverInterface;

class BookingType extends AbstractType
{
        /**
     * @param FormBuilderInterface $builder
     * @param array $options
     */
    public function buildForm(FormBuilderInterface $builder, array $options)
				{
        $builder
										->add('bookcode','text',array(
																												'label'=>'Código de Reserva',
																												'disabled'=>true,
																												'attr'=>array('class'=>'form-control',
																												)
																))
										->add('status','entity',array(
																		'label'=>'Estado',
																		'class'=>'rsBundle:Status',
																		'attr'=>array(
																																	'class'=>'form-control'	
																		)							
																))
										->add('paymethod','entity',array(
																		'label'=>'Método de Pago',
																		'class'=>'rsBundle:Paymethod',
																		'attr'=>array(
																																	'class'=>'form-control'	
																		)							
																))
										->add('comment','textarea',array(
																												'label'=>'Comentario',
																												'max_length'=>500,
																												'attr'=>array('class'=>'form-control',
																				)
																))
										->add('operator','entity',array(
																		'label'=>'Operario',
																		'class'=>'rsBundle:Usuario',
																		'attr'=>array(
																																	'class'=>'form-control'	
																		)							
																))
										->add('customer','entity',array(
																		'label'=>'Cliente',
																		'class'=>'rsBundle:Customer',
																		'attr'=>array(
																																	'class'=>'form-control'	
																		)							
																))
										->add('product','entity',array(
																		'label'=>'Producto',
																	'multiple'=>true,
																		'class'=>'rsBundle:Product',
																		'attr'=>array(
																																	'class'=>'form-control'	
																		)							
																))
            //->add('created')
            //->add('payed')
            //->add('booked')
            //->add('amount')
            //->add('coordinator')
           //->add('aux')
            //->add('ext_response')
        ;
    }
    
    /**
     * @param OptionsResolverInterface $resolver
     */
    public function setDefaultOptions(OptionsResolverInterface $resolver)
    {
        $resolver->setDefaults(array(
            'data_class' => 'vico\reservarBundle\Entity\Booking'
        ));
    }

    /**
     * @return string
     */
    public function getName()
    {
        return 'vico_reservarbundle_booking';
    }
}
